﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="productList.aspx.cs" Inherits="PeisongWeb.admin.productList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>商品信息</title>
    <!--#include file="style.inc"-->
    <style type="text/css">
        .p_span_display
        {
        }
        .p_span_hidden
        {
            display:none;
        }
    </style>

    <script type="text/javascript">
        function resetSrh() {
            document.getElementById("txt_proNo").value = "";
            document.getElementById("txt_proName").value = "";
            document.getElementById("drp_Type").value = "";
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            商品信息
        </h2>
        <span style="<%=power>=2?"": "display:none" %>">
            <ext:Button runat="server" ID="Button1" Icon="Add" Text="新增" OnClientClick="window.open('productEdit.aspx');">
            </ext:Button>
        </span>
        <p>
            &nbsp;</p>
        <ext:Panel ID="Panel1" runat="server" Title="商品搜索" BodyStyle="padding:5px 5px 0"
            Width="960" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content_search">
                    <ul>
                        <li>
                            <label>
                                商品编号
                            </label>
                            <asp:TextBox runat="server" ID="txt_proNo"></asp:TextBox>
                        </li>
                        <li>
                            <label>
                                商品名称
                            </label>
                            <asp:TextBox runat="server" ID="txt_proName"></asp:TextBox>
                        </li>
                        <li>
                            <label>
                                类别</label>
                            <asp:DropDownList runat="server" ID="drp_Type" DataTextField="name" DataValueField="categoryId">
                            </asp:DropDownList>
                        </li>
                        <li>
                            <label>
                                &nbsp;
                            </label>
                            [<asp:LinkButton ID="lbtn_Search" runat="server" Text="搜 索" OnClick="lbtn_Search_Click">
                            </asp:LinkButton>]&nbsp;&nbsp;&nbsp; [<a href="javascript:resetSrh();">重 置</a>]
                        </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
        <p>
            &nbsp;</p>
        <div id="admin_list_content">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>
                        商品编号
                    </th>
                    <th>
                        商品名称
                    </th>
                    <th>
                        小类名称
                    </th>
                    <th>
                        所属大类
                    </th>
                    <th>
                        计量单位
                    </th>
                    <th>
                        规 格
                    </th>
                    <th>
                        是否销售
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                    <ItemTemplate>
                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                            <td>
                                <%# Eval("ProductNo")%>
                            </td>
                            <td>        
                              <a target="_blank" href="../user_productDetail_<%#Eval("productId")%>.html">
                                 <%#Eval("Name")%></a>
                                           
                            </td>
                            <td>
                                <%# Eval("categoryName")%>
                            </td>
                            <td>
                                <%# Eval("categoryParentName")%>
                            </td>
                            <td>
                                <%# Eval("Unit")%>
                            </td>
                            <td>
                                <%# Eval("Standard")%>
                            </td>
                            <td>
                                <%# Convert.ToBoolean(Eval("IsSale")) ? "是" : "否"%>
                            </td>
                            <td>
                                <span class='<%= power>=2? "p_span_display":"p_span_hidden"  %>'>
                                    <a href="productEdit.aspx?product=<%# Eval("productId") %>" target="_blank">编辑/查看</a>
                                    <asp:LinkButton runat="server" CommandName="CopyInsert" CommandArgument='<%#Eval("productId") %>' ID="link_Copy_Insert" Text="复制录入"></asp:LinkButton>
                                </span>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div id="page">
                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text" OnPageChanged="AspNetPager1_PageChanged"
                    runat="server" AlwaysShow="True" PageSize="20" InvalidPageIndexErrorMessage="无效页码"
                    PageIndexOutOfRangeErrorMessage="页码超出范围" ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                    LastPageText="末页" PrevPageText="上一页">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </div>
    <ext:Window ID="windows1" runat="server" Title="复制录入商品" Height="150px" Width="350px"
        BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
        Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
        <Body>
            <table width="98%" align="center" cellpadding="5">
                <tr>
                    <td>
                        商品名称
                    </td>
                    <td>
                        <asp:TextBox runat="server" Width="225px" ID="txtRename"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </Body>
        <Buttons>
            <ext:Button CausesValidation="true" runat="server" ID="btnSave" AutoPostBack="true" Icon="Accept" Text="保存" OnClick="btnSave_Click">
            </ext:Button>
        </Buttons>
    </ext:Window>
    <asp:HiddenField runat="server" ID="hdCurrentProductId" />
    </form>
</body>
</html>
